#pragma once

#pragma unmanaged

#include <BWSAL\BuildEvent.h>

#pragma managed

#include "Build.h"

using namespace System;

namespace BroodWar
{
	namespace Addon
	{
		ref class BuildUnit;
		ref class BuildState;

		public ref class BuildEvent
		{
		internal:
			bool dispose;
			BWSAL::BuildEvent* instance;

			BuildEvent(BWSAL::BuildEvent* evt);
			BuildEvent(BWSAL::BuildEvent evt);
			~BuildEvent();
			!BuildEvent();
		public:
			BuildEvent(BuildType buildType, int deltaMinerals, int deltaGas, int deltaSupply);
			BuildEvent(BuildType buildType, int deltaMinerals, int deltaGas);
			BuildEvent(BuildType buildType, int deltaMinerals);
			BuildEvent(BuildType buildType);

			void Set(BuildType buildType, int deltaMinerals, int deltaGas, int deltaSupply);
			BuildEvent^ SetBuildUnitUnavailable(BuildType type, BuildUnit^ unit);
			BuildEvent^ SetBuildUnitAvailable(BuildType type, BuildUnit^ unit);
			BuildEvent^ SetCompletedBuildType(BuildType type);
			BuildEvent^ UseLarva(BuildUnit^ unit);
			BuildEvent^ SetAddon(BuildUnit^ unit);
			property Build^ BuildType { Build^ get(); }
			property int DeltaMinerals { int get(); }
			property int DeltaGas { int get(); }
			property int DeltaSupply { int get(); }
			property BuildUnit^ UsesLarva { BuildUnit^ get(); }

			virtual String^ ToString() override;
		};

		BuildEvent^ ConvertBuildEvent(BWSAL::BuildEvent* evt);
		BuildEvent^ ConvertBuildEvent(BWSAL::BuildEvent evt);
		BWSAL::BuildEvent ConvertBuildEvent(BuildEvent^ evt);
	}
}
